import { connect } from "dva";
import React, { useEffect } from "react";
import Toolbar from "../components/Toolbar";

function App(props) {
  useEffect(() => {
    console.log("props.children", props.children);
    console.log("props", props);

    return () => {};
  }, []);

  return (
    <div>
      {props.children}
      {props.isShow && <Toolbar></Toolbar>}
    </div>
  );
}

export default connect((model) => {
  const maizuo = model.maizuo.isShow;
  console.log("first ", maizuo);
  return {
    isShow: maizuo,
  };
})(App);
